<?php
    function clean_html($string){

        $string = str_replace('<p>','',$string);
        $string = str_replace('</p>','',$string);
        $string = str_replace('</h1>','',$string);
        $string = str_replace('<h1>','',$string);
        $string = str_replace('</h1>','',$string);
        $string = str_replace('<h2>','',$string);
        $string = str_replace('</h2>','',$string);
        $string = str_replace('<h3>','',$string);
        $string = str_replace('</h3>','',$string);
        $string = str_replace('<h4>','',$string);
        $string = str_replace('</h4>','',$string);
        $string = str_replace('<h5>','',$string);
        $string = str_replace('</h5>','',$string);
        $string = str_replace('<h6>','',$string);
        $string = str_replace('</h6>','',$string);
        $string = str_replace('<br>',' ',$string);
        $string = str_replace('<br/>',' ',$string);
        $string = str_replace('<br />',' ',$string);
        $string = str_replace('<br / >',' ',$string);
        $string = str_replace('<pre>','',$string);
        $string = str_replace('</pre>','',$string);
        $string = str_replace('<address>','',$string);
        $string = str_replace('</address>','',$string);
        $string = str_replace('<b>','',$string);
        $string = str_replace('</b>','',$string);
        $string = str_replace('<strong>','',$string);
        $string = str_replace('</strong>','',$string);

        return $string;

    }

    function clean_html_p($string){

        $string = str_replace('<p>','',$string);
        $string = str_replace('</p>','',$string);

        return $string;

    }

    function clean_html_br($string){

        $string = str_replace('<br>',' ',$string);
        $string = str_replace('<br/>',' ',$string);
        $string = str_replace('<br />',' ',$string);
        $string = str_replace('<br / >',' ',$string);

        return $string;

    }

    //removes paragraph wrom cms words
    function clean_res_array($result_array)
    {

        foreach ($result_array as $key => $value):
            $result_array[$key] = clean_html_p($value);
            endforeach;

        return $result_array;

    }

?>
